DEVICE DATACELL

0.1 Introduction

The DATACELL device, is used to store data in a non-volatile device and is inserted in the family Micro-Qmove when there is no HMI device;
DATACELL has:

0.2 Installation

0.2.1 DEVICE DECLARATION IN THE CONFIGURATION FILE (.CNF)

In the configuration unit (.CNF), the BUS section must be declared so that you have the hardware resources required for the implementation of the DATACELL device.

;---------------------------------
; Internal device declaration
;---------------------------------
INTDEVICE
<device name>       DATACELL         TCamp

where:

<device name>The name assigned to the device.
DATACELLKeyword that identifies the device of recipe management.
TcampTime sampling device (1÷250 ms).

0.2.1.1 Example

;--------------------------------
; Internal device declaration
;--------------------------------
INTDEVICE
dcData      DATACELL      0004

0.3 Operation

The DATACELL device used to access a memory area equal to 8192 long (32768 bytes) available in the non-volatile memory of the instrument. This memory area is designed to be used as a data container for work programmes or recipes.
The device allows you to arrange access to these data through a table with rows (in numbers equal to a “numstep” parameter) and columns (in numbers equal to a “numprog”). In each box of this table you can set up a number of variables of type long from 1 to 6 (in the “numelem” parameter). The user of the device must set the value of the “numelem” and “numstep” parameters and as a result the device counts the number of columns that make up the table and writes in the “numprog” parameter.

The formula that the device uses is:
numprog = 8192 / (numstep * numelem + [1])

The presence of the number [1] depends on the setting of the bit 0 of the “prgsetting” parameter. The 0 bit of the “prgsetting” parameter allows you to assign each program a variable to indicate which is the step to end program.
If for example, we want to create a table to hold the work programmes with 10 steps each and every step with 4 variables, we can have a total number of programs of 204. If you want to assign to each program a variable to indicate which is the step to end program, the number of programs will be 199.
To write the data into the table that is created you have to use the WRITESTEP command. Before using this command, you must set the “progin” and “stepin” parameters the coordinate of the box that you want to write (in progin is write the column and in stepin the row). Also you have to write the values to be transferred into the box in the “elema” … “elemf” parameters. At this point you can store these data in memory by sending WRITESTEP command. The same system is used to write the variable to indicate the step of fineprogramma using the “elemend” parameter.

0.3.1 Example of writing:

[...]
dcData:progin = 2                      ;work program n°2
dcData:stepin = 7                      ;step 7 of the program
dcData:elema = 10                      ;first variable
dcData:elemb = 45678                   ;second variable
dcData:elemc = 12                      ;third variable
dcData:elemd = 345678768               ;fourth variable
dcData:stepout = 0
WRITESTEP dcData                       ;send write command
WAIT dcData:stepout EQ dcData:stepin   ;wait command executed
[...]

To read data from memory, use the READSTEP command. Before using the command you have to set the “progin” and “stepin” parameters the coordinate of the box that you want to read (in progin writing the column and in stepin the row). You can now read the data into memory by sending the READSTEP command. Data read will appear in the “elema” … “elemf” and “elemend” parameters.

0.3.2 Example of reading:

[...]
dcData:progin = 2                      ;work program n°2
dcData:stepin = 7                      ;step 7 of the program
dcData:stepout = 0
READSTEP dcData                        ;send read command
WAIT dcData:stepout EQ dcData:stepin   ;wait command executed
glVar01 = dcData:elema                 ;first variable accessed
glVar02 = dcData:elemb                 ;second variable accessed
glVar03 = dcData:elemc                 ;third variable accessed
glVar04 = dcData:elemd                 ;fourth variable accessed
[...]

0.4 Commands and parameters table

0.4.1 SIMBOLOGIA ADOTTATA

Il nome del parametro, stato o comando è riportato alla sinistra della tabella.

R
Indica se il relativo parametro o stato è ritentivo (al momento dell’inizializzazione del device mantiene lo stato precedentemente definito), oppure lo stato che assume al momento dell’inizializzazione del device.
Se il device non necessita d'inizializzazione il campo “R” indica il valore che il parametro o stato assume all’accensione della scheda.
R = Ritentivo
0 = Al momento dell’inizializzazione del device il valore è forzato a zero.
1 = Al momento dell’inizializzazione del device il valore è forzato a uno.
- = Al momento dell’inizializzazione del device è presentato il valore significativo.

D
Indica la dimensione del parametro.
F = Flag
B = Byte
W = Word
L = Long
S = Single Float

0.4.1.1 Condizioni

Sono descritte tutte le condizioni necessarie affinché il parametro sia considerato corretto o perché il comando sia accettato.
In alcuni casi sono specificati dei valori limite per l’accettazione del parametro: se sono introdotti dei valori esterni ai limiti impostati, il dato è in ogni caso accettato; pertanto devono essere previsti opportuni controlli dell’applicativo tali da garantire il corretto funzionamento.
Per l’esecuzione di un comando, tutte le relative condizioni devono necessariamente essere soddisfatte; in caso contrario il comando non è inviato.

A
Indica il modo d'accesso.
R = Read (lettura).
W = Write (scrittura).
RW = Read / Write.

0.4.2 Parametri

NomeDRACondizioniDescrizione
numelemBRRW-Elements number
Indica il numero di elementi all’interno di un passo
Range valido: 1 ÷ 6
numstepWRRW-Step number
Indica il numero di passi in ogni programma
Range valido: 1 ÷ 8192
numprogW-R-Program number
Indica il numero di programmi disponibili. Il valore dipende da
1) il numero totale di long disponibili in memoria programmi,
2) dal valere del parametro numelem,
3) dal valore del parametro numstep
4) dalla abilitazione del fine programma.
La formula è la seguente:
numprog = 8192 / 1).
proginW0RW-Program input
Indica il numero del programma da memorizzare con il comando WRITESTEP o leggere con il comando READSTEP.
stepinW0RW-Step input
Indica il numero del passo da memorizzare con il comando WRITESTEP o leggere con il comando READSTEP.
stepoutW0RW-Step output
Indica che il passo scritto è stato memorizzato oppure che il passo in lettura è disponibile. Per verificare che il comando inviato (WRITESTEP o READSTEP) è stato eseguito è necessario controllare che stepin = stepout.
elema..fL0RW-Elements A..F
Sono i valori del passo utilizzati con i comandi READSTEP e WRITESTEP
elemendW0RW-Elements for end program
Se diverso da zero Indica che il passo ha fine programma.
readstep--R-ReadStep
Consente la lettura del passo selezionato in stepin
writestep--R-WriteStep
Consente la scrittura del passo selezionato in stepin
prgsettingBRRW-Setting program data-entry
Il bit ZERO abilita l'introduzione del fine programma.
Quando questo bit è 1 il numero di programmi “numprog” diventa:
nuprog = 8192 / (numstep * numelem + 1).
Se il bit “0” e a “0” il numero di programmi diretta:
numprog = 8192 / (numstep * numelem)

0.4.3 Comandi

NomeDRACondizioniDescrizione
readstep--R-ReadStep
Consente la lettura del passo selezionato in stepin
writestep--R-WriteStep
Consente la scrittura del passo selezionato in stepin

0.5 Limitazioni

L'operazione di scrittura tramite il comando WRITESTEP deve essere eseguita tenendo conto che a causa del componente di memoria utilizzato (Flash Eprom seriale) tale operazione risulta onerosa dal punto di vista del tempo utilizzato. Infatti il tempo utilizzato è variabile da 512 a 1024 volte il tempo di campionamento associato device DATACELL. Quindi questo tipo di memoria può essere utilizzato per contenere dei dati che possono essere variati dall'operatore con tempistiche relativamente lente. Sicuramente non è una memoria utilizzabile per contenere dati che devono essere scritti con una alta frequenza. In ogni caso l'operazione di scrittura viene eseguita con una modalità in background e non pregiudica le prestazioni della CPU nel gestire il resto dei device e dell'applicativo.
Per esempio se il tempo di campionamento associato al device è di 6 ms, il tempo per eseguire una scrittura nel device può andare da circa 3 a 6 secondi. Il parametro stepout diventa uguale a stepin dopo questo tempo.
Inoltre il tipo di memoria utilizzato garantisce un numero di scritture pari a 100000. Anche per questo si deve evitare di scrivere dei programmi che scrivino in modo continuo sulla memoria utilizzando il comando WRITESTEP.


1) numstep * numelem) + 1 (se abilitato il fine programma